package com.lc.luzhengtang.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.conn.Conn;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * 文 件 名: NewsListAdapter
 * 创 建 人: zhangyu
 * 创建日期: 16/12/24 19:55
 * 邮   箱: yuanchong121@gmail.com
 * 修改时间：
 * 修改备注：
 */
public class ItemPicAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public ItemPicAdapter(List<String> data) {

        super(R.layout.item_pic, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, final String item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);

//        Glide.with(mContext).load(Conn.HOST3+item).transform(new GlideCircleTransform(mContext)).into((ImageView) helper.getView(R.id.img_glide));
        Glide.with(mContext).load(Conn.HOST3 + item).crossFade().error(R.mipmap.zhanwei).placeholder(R.mipmap.zhanwei).into((ImageView) helper.getView(R.id.img_glide));
        helper.addOnClickListener(R.id.layout_img);
        View view = helper.getConvertView();
      /*  view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent = new Intent();

                //intent.putExtra("url", urlspic.get(position));
//                intent.putStringArrayListExtra("mImages",item);
//                intent.setClass(mContext, PhotoShowActivity.class);
                mContext.startActivity(intent);
            }
        });*/

    }

}
